package cn.ljw.config;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.apache.ibatis.annotations.Mapper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 一朝风月
 * @date 2024/3/27 19:07
 * @Code 面向注解面向卿，终无解释再无你
 * @description Plus配置
 */
@Configuration
@MapperScan("cn.ljw.mapper")
public class MybatisPlusConfig {
    @Bean
    //对象注册为Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor(){
        MybatisPlusInterceptor interceptor=new MybatisPlusInterceptor();
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor());
        return interceptor;//分页拦截器
    }
}
